package com.octopus.optiworks.controller;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

public class CommonValidator implements Validator {
	
	protected static Log log = LogFactory.getLog(CommonValidator.class);
	
	protected boolean stepValided = false;
	
	public CommonValidator(){
		ResourceBundle configuation = ResourceBundle.getBundle("configuration", Locale.getDefault());
		try{
			String value = configuation.getString("form.stepValided");
			if(value != null && value.equals("true"))
				this.stepValided = true;
		}catch(MissingResourceException e){
			log.warn("Missing configuration for the key: form.stepValided");
		}
	}

	public boolean supports(Class<?> arg0) {
		return false;
	}

	public void validate(Object arg0, Errors arg1) {
	
	}

}
